package com.famdoc.Controller;

import com.famdoc.Pojo.dto.Result;
import com.famdoc.Service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页模块
 */
@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    private IndexService indexService;

    /**
     * 获取首页头部数据
     * @return
     */
    @GetMapping("/getIndexHeaderData")
    public Result getIndexHeaderData(Integer doctorId){
        return indexService.getIndexHeaderData(doctorId);
    }

    /**
     * 获取首页工作提醒数据
     * @param doctorId
     * @return
     */
    @GetMapping("/getIndexBodyData")
    public Result getIndexBodyData(Integer doctorId){
        return indexService.getIndexBodyData(doctorId);
    }

    /**
     * 获取所有签约即将到期的患者列表
     * @param keyword
     * @return
     */
    @GetMapping("/getAllNearlyDue")
    public Result getAllNearlyDue(Integer doctorId, String keyword){
        return indexService.getAllNearlyDue(doctorId,keyword);
    }

    /**
     * 获取所有签约到期的患者列表
     * @param doctorId
     * @param keyword
     * @return
     */
    @GetMapping("/getAllDue")
    public Result getAllDue(Integer doctorId, String keyword){
        return indexService.getAllDue(doctorId,keyword);
    }

    /**
     * 获取工作提醒上按人群分类名分类的病人列表
     * @param crowdName
     * @param type
     * @param page
     * @param pageSize
     * @return
     */
    @GetMapping("/getVisitPatientByCrowd")
    public Result getVisitPatientByCrowd(Integer doctorId,String crowdName,
                                         Integer type,Integer page,Integer pageSize){
        return indexService.getVisitPatientByCrowd(doctorId,crowdName,type,page,pageSize);
    }
}
